<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>红包管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../../css/U-gift.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="javascript:history.go(-1)" class="back"></a>
			<p class="pege-name">红包管理</p>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- button -->
		<div class="button">
			<ul class="btn">
				<li class="active">可用</li>
				<li class="">已用</li>
				<li class="">已过期</li>
			</ul>
		</div>
		<!-- button / -->
		<!-- more-list -->
		<div class="Envelope-list">
			<!-- 红包信息 -->
		</div>
		<!-- more-list/ -->
	</div>
<script type="text/javascript" src="../../js/jquery.min.js"></script>
<script type="text/javascript" src="../../js/http-url.js"></script>
<script type="text/javascript" src="../../js/dropload.js"></script>
<script type="text/javascript">
	$(function(){
		var dataClick=null;
		// 加载项目数据
		var load_me;
		loadProject(0,0)
		$('.button .btn').find('li').click(function(){
			if(dataClick){
				return;
			}
			$('.Envelope-list').html('');
			Animete=null
			if(load_me){
				$(".dropload-down").remove();
				// 锁定
                load_me.lock();
	              // 无数据
                load_me.noData();
			}
			$(".dropload-down").remove();
			$('.Envelope-list').html('');
			$('.button .btn').find('li').removeClass('active');
			$(this).addClass('active');
			var index=$(this).index();
			loadProject(index,0)
		});
		function loadProject(projectName,projectsNuber){
			    $('.page-box').dropload({
			        scrollArea : window,
			        loadDownFn : function(me){
			        	dataClick=true;
		        		load_me=me;
		          		ajaxRequest('/api/menu/gift/'+projectName+'/'+projectsNuber+'',true,function(data){
			          	projectsNuber++;
			            // 判断是否加载完毕
			            if(!data.data.R_list){
			               // 锁定
			                me.lock();
			              // 无数据
			              me.noData();
			            }
		           	 	$(data.data.R_list).appendTo('.Envelope-list');
		           	    me.resetload();
		           	    dataClick=null;
			          },false);  
			        },
			        threshold :50
			    });	
			}
	});
</script>
</body>
</html>